#include "fs.h"
#include "param.h"
#include "vnode.h"
#include <minix/vfsif.h>
#include <stdio.h>

/*===========================================================================*
 *                              do_defrag                                    *
 *===========================================================================*/
PUBLIC int do_defrag()
{
  struct vnode * vn;
  int r, response;

  if( (r = frag_get_vnode(&vn)) != 0 )
      return(r);

  if((r = req_defrag(vn->v_fs_e, vn->v_inode_nr, vn->v_dev, &response)) != OK)
      return(EGENERIC); /* This generally shouldn't happen */

  put_vnode(vn);
  return(response);
}
